<?php
/**
 * @package Joomla
 * @subpackage Jmonoslideshow
 * @copyright (C) 2010 - Matthieu BARBE - www.ccomca.com
 * @license GNU/GPL v2
 * 
 * Jmonoslideshow is a Joomla extension for Monoslideshow.
 *
 * Jmonoslideshow uses :
 * Monoslideshow (http://www.monoslideshow.com/)
 * Plupload (http://www.plupload.com/) by Moxicode Systems
 * json class by Michal Migurski, Matt Knapp, Brett Stimmerman
 * jquery a JavaScript Library (http://jquery.com/)
 * getid3 library (http://getid3.sourceforge.net/)
 * swfobject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file (http://code.google.com/p/swfobject/)
 * Chained Selects jQuery Plugin (http://www.appelsiini.net/2010/jquery-chained-selects)
 *
 * Jmonoslideshow is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

$template	= $mainframe->getTemplate();
JHTML::stylesheet( 'monoslideshow.css', 'administrator/components/com_jmonoslideshow/assets/css/' );

if (version_compare(PHP_VERSION, '5.0.0', '<')) {
	// we add the component stylesheet to the installer
	$css = JURI::base().'components/com_jmonoslideshow/assets/monoslideshow.css'; 
	$document =& JFactory::getDocument(); 
	$document->addStyleSheet($css);	

	echo '<div class="alert">';
	echo JText::_( 'COM_JMONOSLIDESHOW_UPGRADE_PHP' ) . '<br />';
	echo '</div>';
}

?>


<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
			<table class="adminlist">
				<tr>
					<td>
						<div id="cpanel">
                        
                        <?php
						global $option;

						$link = 'index.php?option='.$option.'&amp;view=images';
						JmonoslideshowViewJmonoslideshow::quickiconButton( $link, 'icon-48-media.png', JText::_( 'COM_JMONOSLIDESHOW_MEDIAS' ) );
						
						$link = 'index.php?option='.$option.'&amp;view=categories';
						JmonoslideshowViewJmonoslideshow::quickiconButton( $link, 'icon-48-category.png', JText::_( 'COM_JMONOSLIDESHOW_CATEGORIES' ) );
						
						$link = 'index.php?option='.$option.'&amp;view=albums';
						JmonoslideshowViewJmonoslideshow::quickiconButton( $link, 'icon-48-album.png', JText::_( 'COM_JMONOSLIDESHOW_ALBUMS' ) );
						
						$link = 'index.php?option='.$option.'&amp;view=models';
						JmonoslideshowViewJmonoslideshow::quickiconButton( $link, 'icon-48-models.png', JText::_( 'COM_JMONOSLIDESHOW_MODELS' ) );
						
						echo LiveUpdate::getIcon();
						
						$link = 'index.php?option=com_config&controller=component&component=com_jmonoslideshow&path=';
						if ( $this->user->gid >= 25 )JmonoslideshowViewJmonoslideshow::quickiconButton( $link, 'config.png', JText::_( 'COM_JMONOSLIDESHOW_PARAMETERS' ), 1 );
						
						$params = &JComponentHelper::getParams( 'com_jmonoslideshow' );
						$linkeditor = $params->get( 'linkeditor', 'http://pixlr.com/editor/' );
						$link = "window.open('".$linkeditor."','','height=700,width=990,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes'); return false;";
						JmonoslideshowViewJmonoslideshow::quickiconButton( $link, 'edit-image.png', JText::_( 'COM_JMONOSLIDESHOW_EDIT_IMAGES' ), 2 );
						
						$linkhelp = $params->get( 'linkhelp', 'http://jmonoslideshow.com/support/help' );
						JmonoslideshowViewJmonoslideshow::quickiconButton( $linkhelp, 'icon-48-help.png', JText::_( 'COM_JMONOSLIDESHOW_HELP' ), 1 );
						
						?>
                        
                        
                        	</div>
					</td>
				</tr>
			</table>
			</td>
            <td valign="top" width="400px" style="padding: 7px 0 0 5px">
            <?php
			$title = JText::_( 'COM_JMONOSLIDESHOW_UPDATE' );
			echo $this->pane->startPane( 'stat-pane' );
			echo $this->pane->startPanel( $title, 'updatecomponent' );
			
			?>
            
            <?php
				if($this->check['connect'] == 0) {
				?>
					<table class="adminlist">
						<thead>
								<tr>
									<th colspan="2">
									<?php echo JText::_( 'COM_JMONOSLIDESHOW_MONOSLIDESHOW_VERSION' ); ?>
									</th>
								</tr>
						</thead>
						<tbody>
							<tr>
							<td colspan="2">
								<?php
									echo '<b><font color="red">'.JText::_( 'COM_JMONOSLIDESHOW_CONNECTION_FAILED' ).'</font></b>';
								?>
							</td>
							</tr>
						</tbody>
					</table>
				<?php
				} elseif ($this->check['enabled'] == 1) {
				?>
			
			<table class="adminlist">
		<thead>
				<tr>
					<th colspan="2">
					<?php echo JText::_( 'COM_JMONOSLIDESHOW_UPDATE_CHECK' ); ?>
					</th>
				</tr>
		</thead>
		<tbody>
			<tr>
			<td width="33%">
				<?php
		  			if ($this->check['current'] == 0 ) {		  				
						echo JHTML::_('image', 'administrator/templates/'. $template .'/images/header/icon-48-checkin.png', NULL, 'width=32');
		  			} elseif( $this->check['current'] == -1 ) {
		  				echo JHTML::_('image', 'administrator/templates/'. $template .'/images/header/icon-48-info.png', NULL, 'width=32');
		  			} else {
		  				echo JHTML::_('image', 'administrator/templates/'. $template .'/images/header/icon-48-info.png', NULL, 'width=32');
		  			}
		  		?>
			</td>
			<td>
				<?php
		  			if ($this->check['current'] == 0) {
		  				echo '<strong><font color="green">'.JText::_( 'COM_JMONOSLIDESHOW_LATEST_VERSION_INSTALLED' ).'</font></strong>';
		  			} elseif( $this->check['current'] == -1 ) {
		  				echo '<b><font color="red">'.JText::_( 'COM_JMONOSLIDESHOW_OLD_VERSION_CONPONENT' ).'</font></b>';
		  			} else {
		  				echo '<b><font color="orange">'.JText::_( 'COM_JMONOSLIDESHOW_NEWS_VERSION_COMPONENT' ).'</font></b>';
		  			}
		  		?>
			</td>
			</tr>
			<tr>
				<td width="33%">
					<?php echo JText::_( 'COM_JMONOSLIDESHOW_LATEST_VERSION' ).':'; ?>
				</td>
				<td>
					<?php echo $this->check['version']; ?>
				</td>
			</tr>
			<tr>
				<td width="33%">
					<?php echo JText::_( 'COM_JMONOSLIDESHOW_INSTALLED_VERSION' ).':'; ?>
				</td>
				<td>
					<?php echo $this->check['current_version']; ?>
				</td>
			</tr>
			<tr>
				<td width="33%">
					<?php echo JText::_( 'COM_JMONOSLIDESHOW_RELEASED_DATE' ).':'; ?>
				</td>
				<td>
					<?php echo $this->check['released']; ?>
				</td>
			</tr>
            
            <tr>
				<td width="33%">
					<?php echo JText::_( 'COM_JMONOSLIDESHOW_SEE_CHANGELOG' ).':'; ?>
				</td>
				<td>
					<a href="http://jmonoslideshow.org/download/changelog-jmonoslideshow" target="_blank" title="<?php echo JText::_( 'COM_JMONOSLIDESHOW_SEE_CHANGELOG' ); ?>" ><?php echo JText::_( 'COM_JMONOSLIDESHOW_CLIC_HERE' ); ?></a>
				</td>
			</tr>
	</tbody>
</table>
			<?php 
			} 
			?>
			<?php
			echo $this->pane->endPanel();
			
			
			?>
            
            
			
			
			<?php
			
			
			$titleabout= JText::_( 'COM_JMONOSLIDESHOW_ABOUT' );
			echo $this->pane->startPanel( $titleabout, 'about' );
			?>
            <table class="adminlist">
		
		<tbody>
			<tr>
			<td >
				<?php echo JText::_( 'COM_JMONOSLIDESHOW_COMPONENT_MONOSLIDESHOW_FOR_JOOMLA' ); ?>
                <br /><br />
                <?php echo JText::_( 'COM_JMONOSLIDESHOW_ABOUT_MONOSLIDESHOW' ); ?>
			</td>
            </tr>
            </tbody>
            </table>
			
			
			
			
			<?php
			echo $this->pane->endPanel();
			echo $this->pane->endPane();
			
			?>

            
            </td>
            </tr>
            </table>


